package com.woniuxy.mapper;

import com.woniuxy.entity.Conllection;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ConllectionMapper {
    @Select("insert into conllection(user_id,item_id) values(#{userId},#{itemId})")
    void add(Conllection conllection);

    @Delete("delete from conllection where user_id=#{userId} and item_id=#{itemId}")
    void cancel(Conllection conllection);

    @Select("select count(*) from conllection where user_id=#{userId}")
    Integer count(Integer userId);

    @Select("select * from conllection where user_id= #{param1} and item_id= #{param2}")
    Conllection check(Integer userId, Integer itemId);
}
